package com.example.com.common.view.dialog;

import android.app.Dialog;
import android.content.Context;

import java.util.List;

/**
 * 对话框抽象类
 */
public abstract class IDialog {

    public static final int YES = -1;

    public static final int CANCEL = -2;
    private static IDialog dialog;

    public static IDialog getInstance() {
        if (dialog == null) {
            dialog = new DialogImpl();
        }
        return dialog;
    }

    //所有的方法没传title的都表示不需要标题
    //只有一个确定按扭，作提示用
    public abstract Dialog showMessageDialog(Context context, String title, CharSequence msg, final DialogCallBack dialogCallBack);

    /**
     * 显示选择对话框 (默认确定,取消)
     *
     * @param context
     * @param title
     * @param msg
     * @param callback
     */
    public abstract Dialog showChooseDialog(Context context, String title, String msg, DialogCallBack callback);

    public abstract Dialog showChooseDialog(Context context, String title, CharSequence msg, String cancelText, String okText, DialogCallBack callback);

    /**
     * item选择对话框
     *
     * @param context
     * @param title
     * @param items
     * @param callback
     */
    public abstract Dialog showItemDialog(Context context, String title, List<String> items, DialogCallBack callback);

    public abstract Dialog showItemDialog(Context context, String title,
                                          List<String> items, int itemGravity, int titleGravity, final DialogCallBack dialogCallBack);

    public abstract Dialog showActionSheetDialog(Context context, List<String> items, DialogCallBack callback);

    /**
     * 输入框dialog
     */
    public abstract Dialog showInputDialog(Context context, String title, CharSequence msg, String cancelText, String okText, boolean isSingleLine, boolean isCancel,final InputDialogCallBack dialogCallBack);

    /**
     * 显示进度框,
     *
     * @param context
     * @param msg
     * @return
     */
    public abstract Dialog showProgressDialog(Context context, String msg);

    /**
     * 数字进度框
     *
     * @param context
     * @param msg
     * @return
     */
    public abstract Dialog shownNumberProgressDialog(Context context, String msg,int maxProgress);


}
